/**
   http://oj.noi.cn/oj/#main/show/1007
 */
#include<stdio.h> 
int main()
{
	freopen("test6.in", "r", stdin);
	freopen("test6.out", "w", stdout);

	double a = 0;
	double b = 0;
	scanf("%lf %lf", &a, &b);
	
	double k = (int)(a/b);
	double r = a - k*b;
	printf("%.2lf", r);
	return 0;
}
